#include "precompile.h"

#include "Pane.h"

Pane::Pane()
{
	m_id = 0;
	m_dockaction = da_dockLeftOf;
	m_dockneighbor = NULL;
	m_visible = false;
}

Pane::~Pane()
{
}

void Pane::SetDockinfo(dockAction action,IPane* neighbor)
{
	m_dockaction = action;
	m_dockneighbor = neighbor;
}

void Pane::GetDockinfo(dockAction& dock,IPane*& neighbor) const
{
	dock = m_dockaction;
	neighbor = m_dockneighbor;
}

void Pane::SetID(uint32 id)
{
	m_id = id;
}

uint32 Pane::GetID() const
{
	return m_id;
}

void Pane::Update(const InterestedObjects& interestedObjects,IObject* subject,uint32 data)
{
	CObserver::Update(interestedObjects,subject,data);
	UpdateEventArgs args(interestedObjects,subject,data);
	BeingUpdated()(_getself<IPane>(this),&args);
}

void Pane::Setvisible(bool visible/*=true*/)
{
	m_visible = visible;
}

bool Pane::Isvisible() const
{
	return m_visible;
}

void Pane::SetSize(const Size& size)
{
	m_size= size;
}

const Size& Pane::GetSize() const
{
	return m_size;
}

void Pane::WatchObjects(viid subjectIID, viid interestedObjectIID)
{
	RegisterMe(subjectIID,interestedObjectIID);
}

void Pane::UnwatchObjects(viid subjectIID, viid interestedObjectIID)
{
	UnRegisterMe(subjectIID,interestedObjectIID);
}